using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._SpatialAnalystTools._Overlay
{
    /// <summary>
    /// <para>Fuzzy Overlay</para>
    /// <para>Combine fuzzy membership rasters data together, based on selected overlay type.</para>
    /// <para>根据所选叠加类型将模糊成员度栅格数据组合在一起。</para>
    /// </summary>    
    [DisplayName("Fuzzy Overlay")]
    public class FuzzyOverlay : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public FuzzyOverlay()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_rasters">
        /// <para>Input rasters</para>
        /// <para>A list of input membership rasters to be combined in the overlay.</para>
        /// <para>要在叠加中合并的输入成员资格栅格列表。</para>
        /// </param>
        /// <param name="_out_raster">
        /// <para>Output raster</para>
        /// <para><xdoc>
        ///   <para>The output raster which is the result of applying the fuzzy operator.</para>
        ///   <para>This output will always have a value between 0 and 1.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出栅格，它是应用模糊运算符的结果。</para>
        ///   <para>此输出的值始终介于 0 和 1 之间。</para>
        /// </xdoc></para>
        /// </param>
        public FuzzyOverlay(List<object> _in_rasters, object _out_raster)
        {
            this._in_rasters = _in_rasters;
            this._out_raster = _out_raster;
        }
        public override string ToolboxName => "Spatial Analyst Tools";

        public override string ToolName => "Fuzzy Overlay";

        public override string CallName => "sa.FuzzyOverlay";

        public override List<string> AcceptEnvironments => ["autoCommit", "cellSize", "cellSizeProjectionMethod", "compression", "configKeyword", "extent", "geographicTransformations", "mask", "outputCoordinateSystem", "scratchWorkspace", "snapRaster", "tileSize", "workspace"];

        public override object[] ParameterInfo => [_in_rasters, _out_raster, _overlay_type.GetGPValue(), _gamma];

        /// <summary>
        /// <para>Input rasters</para>
        /// <para>A list of input membership rasters to be combined in the overlay.</para>
        /// <para>要在叠加中合并的输入成员资格栅格列表。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input rasters")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public List<object> _in_rasters { get; set; }


        /// <summary>
        /// <para>Output raster</para>
        /// <para><xdoc>
        ///   <para>The output raster which is the result of applying the fuzzy operator.</para>
        ///   <para>This output will always have a value between 0 and 1.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出栅格，它是应用模糊运算符的结果。</para>
        ///   <para>此输出的值始终介于 0 和 1 之间。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_raster { get; set; }


        /// <summary>
        /// <para>Overlay type</para>
        /// <para><xdoc>
        ///   <para>Specifies the method used to combine two or more membership data.</para>
        ///   <bulletList>
        ///     <bullet_item>And—The minimum of the fuzzy memberships from the input fuzzy rasters.</bullet_item><para/>
        ///     <bullet_item>Or—The maximum of the fuzzy memberships from the input rasters.</bullet_item><para/>
        ///     <bullet_item>Product—A decreasive function. Use this when the combination of multiple evidence is less important or smaller than any of the inputs alone.</bullet_item><para/>
        ///     <bullet_item>Sum—An increasive function. Use this when the combination of multiple evidence is more important or larger than any of the inputs alone.</bullet_item><para/>
        ///     <bullet_item>Gamma—The algebraic product of the fuzzy Sum and fuzzy Product, both raised to the power of gamma.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定用于合并两个或多个成员身份数据的方法。</para>
        ///   <bulletList>
        ///     <bullet_item>和—输入模糊栅格的模糊成员的最小值。</bullet_item><para/>
        ///     <bullet_item>或 - 输入栅格的模糊成员的最大值。</bullet_item><para/>
        ///     <bullet_item>乘积 - 递减函数。当多个证据的组合不如单独的任何输入重要或更小时，请使用此选项。</bullet_item><para/>
        ///     <bullet_item>Sum - 递增函数。当多个证据的组合比单独的任何输入更重要或更大时，请使用此选项。</bullet_item><para/>
        ///     <bullet_item>Gamma - 模糊和积和模糊积的代数乘积，两者都提高到 gamma 的幂。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Overlay type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _overlay_type_value _overlay_type { get; set; } = _overlay_type_value._AND;

        public enum _overlay_type_value
        {
            /// <summary>
            /// <para>And</para>
            /// <para>And—The minimum of the fuzzy memberships from the input fuzzy rasters.</para>
            /// <para>和—输入模糊栅格的模糊成员的最小值。</para>
            /// </summary>
            [Description("And")]
            [GPEnumValue("AND")]
            _AND,

            /// <summary>
            /// <para>Or</para>
            /// <para>Or—The maximum of the fuzzy memberships from the input rasters.</para>
            /// <para>或 - 输入栅格的模糊成员的最大值。</para>
            /// </summary>
            [Description("Or")]
            [GPEnumValue("OR")]
            _OR,

            /// <summary>
            /// <para>Sum</para>
            /// <para>Sum—An increasive function. Use this when the combination of multiple evidence is more important or larger than any of the inputs alone.</para>
            /// <para>Sum - 递增函数。当多个证据的组合比单独的任何输入更重要或更大时，请使用此选项。</para>
            /// </summary>
            [Description("Sum")]
            [GPEnumValue("SUM")]
            _SUM,

            /// <summary>
            /// <para>Product</para>
            /// <para>Product—A decreasive function. Use this when the combination of multiple evidence is less important or smaller than any of the inputs alone.</para>
            /// <para>乘积 - 递减函数。当多个证据的组合不如单独的任何输入重要或更小时，请使用此选项。</para>
            /// </summary>
            [Description("Product")]
            [GPEnumValue("PRODUCT")]
            _PRODUCT,

            /// <summary>
            /// <para>Gamma</para>
            /// <para>Gamma—The algebraic product of the fuzzy Sum and fuzzy Product, both raised to the power of gamma.</para>
            /// <para>Gamma - 模糊和积和模糊积的代数乘积，两者都提高到 gamma 的幂。</para>
            /// </summary>
            [Description("Gamma")]
            [GPEnumValue("GAMMA")]
            _GAMMA,

        }

        /// <summary>
        /// <para>Gamma</para>
        /// <para><xdoc>
        ///   <para>The gamma value to be used. This is only available when the Overlay type is set to Gamma.</para>
        ///   <para>Default value is 0.9.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>要使用的 gamma 值。仅当 Overlay 类型设置为 Gamma 时，此功能才可用。</para>
        ///   <para>默认值为 0.9。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Gamma")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _gamma { get; set; } = 0.9;


        public FuzzyOverlay SetEnv(int? autoCommit = null, object cellSize = null, object compression = null, object configKeyword = null, object extent = null, object geographicTransformations = null, object mask = null, object outputCoordinateSystem = null, object scratchWorkspace = null, object snapRaster = null, double[] tileSize = null, object workspace = null)
        {
            base.SetEnv(autoCommit: autoCommit, cellSize: cellSize, compression: compression, configKeyword: configKeyword, extent: extent, geographicTransformations: geographicTransformations, mask: mask, outputCoordinateSystem: outputCoordinateSystem, scratchWorkspace: scratchWorkspace, snapRaster: snapRaster, tileSize: tileSize, workspace: workspace);
            return this;
        }

    }

}